// Copyright 叶湘 ( weixin:yexiang841, email:yexiang841@qq.com ), Shitouren Studio. All Rights Reserved.

#pragma once

#include "CoreMinimal.h"
#include "UObject/NoExportTypes.h"
#include "Property/Q3D_CPPE_PropertyName.h"
#include "Hit/Q3D_CPPE_HitType.h"
#include "Hit/Q3D_CPPE_HitDamageStyle.h"
#include "Hit/Q3D_CPPE_HitMode.h"
#include "Hit/Q3D_CPPE_HitValue.h"
#include "Q3D_CPPU_Hit.generated.h"

class UQ3D_CPPU_Hit;
class UQ3D_CPPU_HitTypeBase;
class UQ3D_CPPU_HitModeBase;
class UQ3D_CPPU_HitValueBase;
class UQ3D_CPPU_PropertyPLIPro;

DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FQ3D_D_Hit_Once, UQ3D_CPPU_Hit *, ptr_u_hit);
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FQ3D_D_Hit_Done, UQ3D_CPPU_Hit *, ptr_u_hit);
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FQ3D_D_Hit_Cancel, UQ3D_CPPU_Hit *, ptr_u_hit);
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FQ3D_D_Halo_Start, UQ3D_CPPU_Hit *, ptr_u_hit);
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FQ3D_D_Halo_Done, UQ3D_CPPU_Hit *, ptr_u_hit);
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FQ3D_D_Halo_Cancel, UQ3D_CPPU_Hit *, ptr_u_hit);

/**
 * 
 */
UCLASS(Blueprintable, ClassGroup = (Q3D), meta = (Tooltip = "基础伤害类(C++)"))
class Q3D_LIB_API UQ3D_CPPU_Hit : public UObject
{
	GENERATED_BODY()

public: // 这部分对构造函数暴露
	UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = Q3D_Hit, meta = (Tooltip = "全局 ID", ExposeOnSpawn = "true"))
	FName Name_Id;

	UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = Q3D_Hit, meta = (Tooltip = "目标属性名", ExposeOnSpawn = "true"))
	EQ3D_CPPE_PropertyName Enum_PropertyName;

public:
	UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = Q3D_Hit, meta = (Tooltip = "命中类型：伤害/恢复"))
	UQ3D_CPPU_HitTypeBase *Ptr_U_HitType;

	UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = Q3D_Hit, meta = (Tooltip = "命中模式：单次命中/多次命中/持续命中/光环"))
	UQ3D_CPPU_HitModeBase *Ptr_U_HitMode;

	UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = Q3D_Hit, meta = (Tooltip = "命中值类型：整数值/百分比"))
	UQ3D_CPPU_HitValueBase *Ptr_U_HitValue;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Q3D_Hit, meta = (Tooltip = "命中的来源"))
	AActor *Ptr_A_HitMaker;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Q3D_Hit, meta = (Tooltip = "命中的媒介(直接引发者)"))
	AActor *Ptr_A_HitCauser;

	UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = Q3D_Hit, meta = (Tooltip = "命中的目标"))
	AActor *Ptr_A_HitTarget;

public:
	UFUNCTION(BlueprintCallable, Category = Q3D_Hit, meta = (Tooltip = "由 HitMaker 调用：单节点快速设置 Hit，但不设置 HitTarget，延后由 HitCauser 完成 SetToTarget"))
	void Q3D_F_Hit_Set(EQ3D_CPPE_HitType enum_hit_type, EQ3D_CPPE_HitMode enum_hit_mode, int int_hit_count, float float_hit_interval, float float_halo_time, EQ3D_CPPE_HitValue enum_hit_value, int int_value_int, float float_percent_by_max, float float_percent_by_now, AActor *ptr_a_hit_maker, AActor *ptr_a_hit_causer, UPARAM(DisplayName = "ptr_u_hit") UQ3D_CPPU_Hit *&ptr_u_hit);

	UFUNCTION(BlueprintCallable, Category = Q3D_Hit, meta = (Tooltip = "由 HitMaker/HitCauser 调用：单节点快速设置 Hit，并马上施加到 HitTarget"))
	void Q3D_F_Hit_SetToTarget(EQ3D_CPPE_HitType enum_hit_type, EQ3D_CPPE_HitMode enum_hit_mode, int int_hit_count, float float_hit_interval, float float_halo_time, EQ3D_CPPE_HitValue enum_hit_value, int int_value_int, float float_percent_by_max, float float_percent_by_now, AActor *ptr_a_hit_maker, AActor *ptr_a_hit_causer, AActor *ptr_a_hit_target, UPARAM(DisplayName = "ptr_u_hit") UQ3D_CPPU_Hit *&ptr_u_hit, UPARAM(DisplayName = "bool_success") bool &bool_success, UPARAM(DisplayName = "string_log") FString &string_log);

	UFUNCTION(BlueprintCallable, Category = Q3D_Hit, meta = (Tooltip = "由 HitMaker/HitCauser 调用：如果 HitType/HitMode/HitValue 都已经设置过(不为空)，且 HitTarget 符合条件，则将 Hit 发往 HitTarget"))
	void Q3D_F_SetToTarget(AActor *ptr_a_hit_target, UPARAM(DisplayName = "bool_success") bool &bool_success, UPARAM(DisplayName = "string_log") FString &string_log);

	UFUNCTION(BlueprintCallable, Category = Q3D_Hit, meta = (Tooltip = "由 HitMaker/HitCauser 调用：设置 HitType 为伤害，并指定攻击相性"))
	void Q3D_F_HitType_SetDamage(UPARAM(DisplayName = "ptr_u_hit") UQ3D_CPPU_Hit *&ptr_u_hit);

	UFUNCTION(BlueprintCallable, Category = Q3D_Hit, meta = (Tooltip = "由 HitMaker/HitCauser 调用：由 HitCauser 调用：设置攻击相性"))
	void Q3D_F_HitDamageStyle_Set(EQ3D_CPPE_HitDamageStyle enum_hit_damage_style, UPARAM(DisplayName = "ptr_u_hit") UQ3D_CPPU_Hit *&ptr_u_hit);

	UFUNCTION(BlueprintCallable, Category = Q3D_Hit, meta = (Tooltip = "由 HitMaker/HitCauser 调用：设置 HitType 为恢复"))
	void Q3D_F_HitType_SetRecover(UPARAM(DisplayName = "ptr_u_hit") UQ3D_CPPU_Hit *&ptr_u_hit);

	UFUNCTION(BlueprintPure, Category = Q3D_Hit, meta = (Tooltip = "获取命中类型(HitType)"))
	void Q3D_F_HitType_GetEnum(UPARAM(DisplayName = "enum_hit_type") EQ3D_CPPE_HitType &enum_hit_type) const;
	EQ3D_CPPE_HitType Q3D_F_HitType_GetEnum() const;

	UFUNCTION(BlueprintCallable, Category = Q3D_Hit, meta = (Tooltip = "由 HitMaker/HitCauser 调用：设置 HitMode 为单次命中，暂不发往 HitTarget"))
	void Q3D_F_HitMode_SetHitOnce(UPARAM(DisplayName = "ptr_u_hit") UQ3D_CPPU_Hit *&ptr_u_hit);

	UFUNCTION(BlueprintCallable, Category = Q3D_Hit, meta = (Tooltip = "由 HitMaker/HitCauser 调用：设置 HitMode 为多次命中，暂不发往 HitTarget"))
	void Q3D_F_HitMode_SetHitMultiple(int int_hit_count, float float_hit_interval, UPARAM(DisplayName = "ptr_u_hit") UQ3D_CPPU_Hit *&ptr_u_hit);

	UFUNCTION(BlueprintCallable, Category = Q3D_Hit, meta = (Tooltip = "由 HitMaker/HitCauser 调用：设置 HitMode 为持续命中，暂不发往 HitTarget"))
	void Q3D_F_HitMode_SetHitInfinite(float float_hit_interval, UPARAM(DisplayName = "ptr_u_hit") UQ3D_CPPU_Hit *&ptr_u_hit);

	UFUNCTION(BlueprintCallable, Category = Q3D_Hit, meta = (Tooltip = "由 HitMaker/HitCauser 调用：设置 HitMode 为持续光环，暂不发往 HitTarget"))
	void Q3D_F_HitMode_SetHaloConst(UPARAM(DisplayName = "ptr_u_hit") UQ3D_CPPU_Hit *&ptr_u_hit);

	UFUNCTION(BlueprintCallable, Category = Q3D_Hit, meta = (Tooltip = "由 HitMaker/HitCauser 调用：设置 HitMode 为计时光环，暂不发往 HitTarget"))
	void Q3D_F_HitMode_SetHaloTimed(float float_halo_time, UPARAM(DisplayName = "ptr_u_hit") UQ3D_CPPU_Hit *&ptr_u_hit);

	UFUNCTION(BlueprintCallable, Category = Q3D_Hit, meta = (Tooltip = "由 HitMaker/HitCauser 调用：设置 HitValue 为伤害值(正整数)，暂不发往 HitTarget"))
	void Q3D_F_HitValue_SetInt(int32 int_value_int, UPARAM(DisplayName = "ptr_u_hit") UQ3D_CPPU_Hit *&ptr_u_hit);

	UFUNCTION(BlueprintPure, Category = Q3D_Hit, meta = (Tooltip = "获取命中模式(HitMode)"))
	void Q3D_F_HitMode_GetEnum(UPARAM(DisplayName = "enum_hit_mode") EQ3D_CPPE_HitMode &enum_hit_mode) const;
	EQ3D_CPPE_HitMode Q3D_F_HitMode_GetEnum() const;

	UFUNCTION(BlueprintCallable, Category = Q3D_Hit, meta = (Tooltip = "由 HitMaker/HitCauser 调用：设置 HitValue 为最大值百分比值，暂不发往 HitTarget"))
	void Q3D_F_HitValue_SetPercentByMax(float float_percent_by_max, UPARAM(DisplayName = "ptr_u_hit") UQ3D_CPPU_Hit *&ptr_u_hit);

	UFUNCTION(BlueprintCallable, Category = Q3D_Hit, meta = (Tooltip = "由 HitMaker/HitCauser 调用：设置 HitValue 为当前值百分比值，暂不发往 HitTarget"))
	void Q3D_F_HitValue_SetPercentByNow(float float_percent_by_now, UPARAM(DisplayName = "ptr_u_hit") UQ3D_CPPU_Hit *&ptr_u_hit);

	UFUNCTION(BlueprintPure, Category = Q3D_Hit, meta = (Tooltip = "获取命中值类型(HitValue)"))
	void Q3D_F_HitValue_GetEnum(UPARAM(DisplayName = "enum_hit_value") EQ3D_CPPE_HitValue &enum_hit_value) const;
	EQ3D_CPPE_HitValue Q3D_F_HitValue_GetEnum() const;

	UFUNCTION(BlueprintPure, Category = Q3D_Hit, meta = (Tooltip = "获取最终伤害值"))
	void Q3D_F_HitValue_Get(UPARAM(DisplayName = "int_hit_value") int32 &int_hit_value) const;
	int32 Q3D_F_HitValue_Get() const;

	UFUNCTION(BlueprintCallable, Category = Q3D_Hit, meta = (Tooltip = "由 HitMaker/HitCauser 调用：设置命中来源"))
	void Q3D_F_HitMaker_Set(AActor *ptr_a_hit_maker, UPARAM(DisplayName = "ptr_u_hit") UQ3D_CPPU_Hit *&ptr_u_hit);

	UFUNCTION(BlueprintCallable, Category = Q3D_Hit, meta = (Tooltip = "由 HitMaker/HitCauser 调用：设置命中媒介(直接引发者)"))
	void Q3D_F_HitCauser_Set(AActor *ptr_a_hit_causer, UPARAM(DisplayName = "ptr_u_hit") UQ3D_CPPU_Hit *&ptr_u_hit);

	UFUNCTION(BlueprintPure, Category = Q3D_Hit, meta = (Tooltip = "获取命中值类型(HitValue)"))
	void Q3D_F_PropertyPLIPro_Get(UPARAM(DisplayName = "ptr_u_property_pli_pro") UQ3D_CPPU_PropertyPLIPro *&ptr_u_property_pli_pro, UPARAM(DisplayName = "string_log") FString &string_log) const;

	UFUNCTION(BlueprintCallable, Category = Q3D_Hit, meta = (Tooltip = "由 HitTarget 接口类型调用：开始执行 Hit。HitCauser 只能决定基础 Hit 值，最终还是要由 HitTarget 根据自己的属性、相性等决定 Hit 值"))
	void Q3D_F_Hit_Execute_ByHitTarget(UPARAM(DisplayName = "bool_success") bool &bool_success, UPARAM(DisplayName = "string_log") FString &string_log);

	UFUNCTION(BlueprintCallable, Category = Q3D_Hit, meta = (Tooltip = "由任何 Actor 类型的 HitTarget 调用：开始执行 Hit。HitCauser 只能决定基础 Hit 值，最终还是要由 HitTarget 根据自己的属性、相性等决定 Hit 值"))
	void Q3D_F_Hit_Execute_OnProperty(UQ3D_CPPU_PropertyPLIPro *ptr_u_property_pli_pro, UPARAM(DisplayName = "bool_success") bool &bool_success, UPARAM(DisplayName = "string_log") FString &string_log);

	UFUNCTION(BlueprintCallable, Category = Q3D_Hit, meta = (Tooltip = "终止 Hit(取消 Multiple/Infinite/Halo)，可以由 HitMaker/HitCauser 调用(主动取消 Hit)，也可以由 HitTarget 调用(自行清除 Hit)"))
	void Q3D_F_Hit_Cancel(UPARAM(DisplayName = "bool_success") bool &bool_success, UPARAM(DisplayName = "string_log") FString &string_log);

	UFUNCTION(BlueprintPure, Category = Q3D_Hit, meta = (Tooltip = "序列化为字符串，主要为了日志"))
	void Q3D_F_ToString(UPARAM(DisplayName = "string_info") FString &string_info) const;
	FString Q3D_F_ToString() const;

public:
	virtual class UWorld *GetWorld() const override;

public:
	UPROPERTY(BlueprintAssignable, Category = Q3D_PlayerState, meta = (Tooltip = "多播代理：Hit(不包括 Halo)执行了一次"))
	FQ3D_D_Hit_Once Q3D_ED_Hit_Once;

	UPROPERTY(BlueprintAssignable, Category = Q3D_PlayerState, meta = (Tooltip = "多播代理：Hit(不包括 Halo)全部执行完毕"))
	FQ3D_D_Hit_Done Q3D_ED_Hit_Done;

	UPROPERTY(BlueprintAssignable, Category = Q3D_PlayerState, meta = (Tooltip = "多播代理：Hit(不包括 Halo)已取消"))
	FQ3D_D_Hit_Cancel Q3D_ED_Hit_Cancel;

	UPROPERTY(BlueprintAssignable, Category = Q3D_PlayerState, meta = (Tooltip = "多播代理：Halo 已经在执行"))
	FQ3D_D_Halo_Start Q3D_ED_Halo_Start;

	UPROPERTY(BlueprintAssignable, Category = Q3D_PlayerState, meta = (Tooltip = "多播代理：Halo 计时结束"))
	FQ3D_D_Halo_Done Q3D_ED_Halo_Done;

	UPROPERTY(BlueprintAssignable, Category = Q3D_PlayerState, meta = (Tooltip = "多播代理：Halo 已取消"))
	FQ3D_D_Halo_Cancel Q3D_ED_Halo_Cancel;
};
